﻿<Window x:Class="GoldDigger.Editor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:jas="clr-namespace:WPF.JoshSmith.Controls"
        xmlns:local="clr-namespace:GoldDigger.Editor"
        Title="MainWindow" ResizeMode="NoResize" Height="550" Width="800">
    <Window.Resources>
        <Style x:Key="Wood" TargetType="Image">
            <Setter Property="Width" Value="68"></Setter>
            <Setter Property="Height" Value="20"></Setter>
            <Setter Property="Source" Value="Images/wood.png"></Setter>
        </Style>
        
        <Style x:Key="WoodChain" BasedOn="{StaticResource Wood}" TargetType="Image">
            <Setter Property="jas:DragCanvas.CanBeDragged" Value="False"></Setter>
            <Setter Property="Canvas.Top" Value="100"></Setter>
        </Style>

        <Style x:Key="TemplateItem" TargetType="Image">
            <Setter Property="Margin" Value="5"></Setter>
        </Style>

        <Style x:Key="SmallGold" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="20"></Setter>
            <Setter Property="Height" Value="20"></Setter>
            <Setter Property="Source" Value="Images/gold.png"></Setter>
        </Style>

        <Style x:Key="MediumGold" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="30"></Setter>
            <Setter Property="Height" Value="30"></Setter>
            <Setter Property="Source" Value="Images/gold.png"></Setter>
        </Style>

        <Style x:Key="BigGold" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="50"></Setter>
            <Setter Property="Height" Value="50"></Setter>
            <Setter Property="Source" Value="Images/gold.png"></Setter>
        </Style>

        <Style x:Key="SmallRock" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="35"></Setter>
            <Setter Property="Height" Value="35"></Setter>
            <Setter Property="Source" Value="Images/smallrock.png"></Setter>
        </Style>

        <Style x:Key="BigRock" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="60"></Setter>
            <Setter Property="Height" Value="60"></Setter>
            <Setter Property="Source" Value="Images/bigrock.png"></Setter>
        </Style>

        <Style x:Key="Diamond" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="23"></Setter>
            <Setter Property="Height" Value="23"></Setter>
            <Setter Property="Source" Value="Images/diamond.png"></Setter>
        </Style>

        <Style x:Key="Bucket" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="65"></Setter>
            <Setter Property="Height" Value="45"></Setter>
            <Setter Property="Source" Value="Images/bucket.png"></Setter>
        </Style>

        <Style x:Key="Bomb" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="35"></Setter>
            <Setter Property="Height" Value="35"></Setter>
            <Setter Property="Source" Value="Images/bomb.png"></Setter>
        </Style>

        <Style x:Key="Bag" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="35"></Setter>
            <Setter Property="Height" Value="35"></Setter>
            <Setter Property="Source" Value="Images/bag.png"></Setter>
        </Style>

        <Style x:Key="Bird" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="40"></Setter>
            <Setter Property="Height" Value="30"></Setter>
            <Setter Property="Source" Value="Images/bird.png"></Setter>
        </Style>

        <Style x:Key="DiamondBird" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="45"></Setter>
            <Setter Property="Height" Value="35"></Setter>
            <Setter Property="Source" Value="Images/diamondbird.png"></Setter>
        </Style>

        <Style x:Key="Chest" TargetType="Image" BasedOn="{StaticResource TemplateItem}">
            <Setter Property="Width" Value="60"></Setter>
            <Setter Property="Height" Value="60"></Setter>
            <Setter Property="Source" Value="Images/chest.png"></Setter>
        </Style>

    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="New" Executed="NewCommand_Executed"></CommandBinding>
        <CommandBinding Command="Save" Executed="SaveCommand_Executed"></CommandBinding>
        <CommandBinding Command="Open" Executed="OpenCommand_Executed"></CommandBinding>
    </Window.CommandBindings>
    <StackPanel>
        <Menu>
            <MenuItem Command="New"></MenuItem>
            <MenuItem Command="Open"></MenuItem>
            <MenuItem Command="Save"></MenuItem>
        </Menu>
        <StackPanel FlowDirection="LeftToRight" VerticalAlignment="Center" Height="70" Orientation="Horizontal"
                    x:Name="itemPanel" PreviewMouseLeftButtonDown="itemPanel_PreviewMouseLeftButtonDown" PreviewMouseMove="itemPanel_PreviewMouseMove" >
            <Image Style="{StaticResource BigGold}" local:Item.Type="BigGold"></Image>
            <Image Style="{StaticResource MediumGold}" local:Item.Type="MediumGold"></Image>
            <Image Style="{StaticResource SmallGold}" local:Item.Type="SmallGold"></Image>
            <Image Style="{StaticResource Bomb}" local:Item.Type="Bomb"></Image>
            <Image Style="{StaticResource Diamond}" local:Item.Type="Diamond"></Image>
            <Image Style="{StaticResource Bucket}" local:Item.Type="Bucket"></Image>
            <Image Style="{StaticResource SmallRock}" local:Item.Type="SmallRock"></Image>
            <Image Style="{StaticResource BigRock}" local:Item.Type="BigRock"></Image>
            <Image Style="{StaticResource Bird}" local:Item.Type="Bird"></Image>
            <Image Style="{StaticResource DiamondBird}" local:Item.Type="DiamondBird"></Image>
            <Image Style="{StaticResource Bag}" local:Item.Type="Bag"></Image>
            <Image Style="{StaticResource Chest}" local:Item.Type="Chest"></Image>
        </StackPanel>
        <jas:DragCanvas Height="480" Width="800" x:Name="canvasScene" AllowDrop="True" DragEnter="canvasScene_DragEnter" Drop="canvasScene_Drop">
            <jas:DragCanvas.Background>
                <ImageBrush ImageSource="Images/bg.png"></ImageBrush>
            </jas:DragCanvas.Background>
            <Image Style="{StaticResource WoodChain}"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="65"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="130"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="195"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="260"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="325"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="390"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="455"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="520"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="585"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="650"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="715"></Image>
            <Image Style="{StaticResource WoodChain}" Canvas.Left="780"></Image>
        </jas:DragCanvas>
    </StackPanel>
</Window>
